﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：WTB_BAOXIUXX实体层次
//********************************************************************************//
#region Entity
namespace Entity
{
    using System;
    using System.Xml;
    [Serializable()]
    public class WTB_BAOXIUXX
    {

        private int m_bt_id;
        /// <summary>
        /// ID自增长，禁止关联
        /// </summary>
        public int ID { get { return m_bt_id; } set { m_bt_id = value; } }

        private string m_str_s_zhubiaobh;
        /// <summary>
        /// 主表编号
        /// </summary>
        public string S_ZHUBIAOBH { get { return m_str_s_zhubiaobh; } set { m_str_s_zhubiaobh = value; } }

        private string m_str_incident_id;
        /// <summary>
        /// 申请单唯一ID
        /// </summary>
        public string INCIDENT_ID { get { return m_str_incident_id; } set { m_str_incident_id = value; } }

        private string m_str_case_type_cd;
        /// <summary>
        /// 案例类型 固定值：报修
        /// </summary>
        public string CASE_TYPE_CD { get { return m_str_case_type_cd; } set { m_str_case_type_cd = value; } }

        private string m_str_fyly;
        /// <summary>
        /// 反映来源 
        /// </summary>
        public string FYLY { get { return m_str_fyly; } set { m_str_fyly = value; } }

        private string m_str_fyxs;
        /// <summary>
        /// 反映形式
        /// </summary>
        public string FYXS { get { return m_str_fyxs; } set { m_str_fyxs = value; } }

        private string m_str_fyqm;
        /// <summary>
        /// 反映区名
        /// </summary>
        public string FYQM { get { return m_str_fyqm; } set { m_str_fyqm = value; } }

        private string m_str_fylb;
        /// <summary>
        /// 反映类别
        /// </summary>
        public string FYLB { get { return m_str_fylb; } set { m_str_fylb = value; } }

        private string m_str_fynr;
        /// <summary>
        /// 反映内容
        /// </summary>
        public string FYNR { get { return m_str_fynr; } set { m_str_fynr = value; } }

        private string m_str_bx_dttm;
        /// <summary>
        /// 报修时间/反映时间
        /// </summary>
        public string BX_DTTM { get { return m_str_bx_dttm; } set { m_str_bx_dttm = value; } }

        private string m_str_cljb;
        /// <summary>
        /// 处理级别
        /// </summary>
        public string CLJB { get { return m_str_cljb; } set { m_str_cljb = value; } }

        private string m_str_cn_dttm;
        /// <summary>
        /// 承诺时间
        /// </summary>
        public string CN_DTTM { get { return m_str_cn_dttm; } set { m_str_cn_dttm = value; } }

        private string m_str_bx_loc_cd;
        /// <summary>
        /// 报修位置
        /// </summary>
        public string BX_LOC_CD { get { return m_str_bx_loc_cd; } set { m_str_bx_loc_cd = value; } }

        private string m_str_repair_comment;
        /// <summary>
        /// 备注信息
        /// </summary>
        public string REPAIR_COMMENT { get { return m_str_repair_comment; } set { m_str_repair_comment = value; } }

        private int? m_bt_i_beiyong1;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG1 { get { return m_bt_i_beiyong1; } set { m_bt_i_beiyong1 = value; } }

        private int? m_bt_i_beiyong2;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG2 { get { return m_bt_i_beiyong2; } set { m_bt_i_beiyong2 = value; } }

        private int? m_bt_i_beiyong3;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG3 { get { return m_bt_i_beiyong3; } set { m_bt_i_beiyong3 = value; } }

        private string m_str_s_beiyong1;
        /// <summary>
        /// 提交渠道|预约时间|
        /// </summary>
        public string S_BEIYONG1 { get { return m_str_s_beiyong1; } set { m_str_s_beiyong1 = value; } }

        private string m_str_s_beiyong2;
        /// <summary>
        /// 
        /// </summary>
        public string S_BEIYONG2 { get { return m_str_s_beiyong2; } set { m_str_s_beiyong2 = value; } }

        private string m_str_s_beiyong3;
        /// <summary>
        /// 
        /// </summary>
        public string S_BEIYONG3 { get { return m_str_s_beiyong3; } set { m_str_s_beiyong3 = value; } }

        private DateTime? m_DT_d_beiyong1;
        /// <summary>
        /// 
        /// </summary>
        public DateTime? D_BEIYONG1 { get { return m_DT_d_beiyong1; } set { m_DT_d_beiyong1 = value; } }

        private DateTime? m_DT_d_beiyong2;
        /// <summary>
        /// 
        /// </summary>
        public DateTime? D_BEIYONG2 { get { return m_DT_d_beiyong2; } set { m_DT_d_beiyong2 = value; } }

        private DateTime? m_DT_d_beiyong3;
        /// <summary>
        /// 
        /// </summary>
        public DateTime? D_BEIYONG3 { get { return m_DT_d_beiyong3; } set { m_DT_d_beiyong3 = value; } }
        public WTB_BAOXIUXX()
        {
        }
    }
}
#endregion
#region EntityProcess
namespace Access.BLL
{
    using System;
    using System.Data;
    //using System.Data.OracleClient;
    using Entity;
    using System.Configuration;
    using System.Data.Common;
    using Platform.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using Oracle.DataAccess;
    public class WTB_BAOXIUXXProcess
    {
        #region Field
        protected string conn;
        #endregion
        #region Construction
        public WTB_BAOXIUXXProcess() { conn = Platform.Configuration.ConfigHelper.BusinessConnString; }
        #endregion
        #region public

        /// <summary>
        /// 根据WTB_BAOXIUXX实体添加或者修改WTB_BAOXIUXX信息
        /// </summary>
        public bool InsertOrUpdate(WTB_BAOXIUXX WTB_BAOXIUXX, OracleTransaction Transaction)
        {
            if (WTB_BAOXIUXX.ID == 0)
            {
                InsertWTB_BAOXIUXX(WTB_BAOXIUXX, Transaction);
            }
            else
            {
                UpdateWTB_BAOXIUXX(WTB_BAOXIUXX, Transaction);
            }
            return WTB_BAOXIUXX.ID == 0 ? false : true;
        }

        /// <summary>
        /// 根据WTB_BAOXIUXX实体添加或修改WTB_BAOXIUXX信息
        /// </summary>
        public bool InsertOrUpdate(WTB_BAOXIUXX WTB_BAOXIUXX)
        {
            return InsertOrUpdate(WTB_BAOXIUXX, null);
        }



        /// <summary>
        /// 根据WTB_BAOXIUXX主键删除WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteWTB_BAOXIUXX(int ID, OracleTransaction Transaction)
        {
            string spName = "CS_DelWTB_BAOXIUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据WTB_BAOXIUXX主键删除WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteWTB_BAOXIUXX(int ID)
        {
            return DeleteWTB_BAOXIUXX(ID, null);
        }

        /// <summary>
        /// 根据条件删除WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteWTB_BAOXIUXXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            string spName = "CS_DelWTB_BAOXIUXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据条件删除WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteWTB_BAOXIUXXesDynamic(string WhereClause)
        {
            return DeleteWTB_BAOXIUXXesDynamic(WhereClause, null);
        }

        /// <summary>
        /// 根据WTB_BAOXIUXX主键选择WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_BAOXIUXX信息</returns>
        public WTB_BAOXIUXX SelectWTB_BAOXIUXX(int ID, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_BAOXIUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                WTB_BAOXIUXX WTB_BAOXIUXX = PopulateWTB_BAOXIUXX(rd);
                rd.Close();
                return WTB_BAOXIUXX;
            }
            else
                return null;
        }

        /// <summary>
        /// 根据WTB_BAOXIUXX主键选择WTB_BAOXIUXX信息
        /// </summary>
        /// <returns>WTB_BAOXIUXX信息</returns>
        public WTB_BAOXIUXX SelectWTB_BAOXIUXX(int ID)
        {
            return SelectWTB_BAOXIUXX(ID, null);
        }

        /// <summary>
        /// 选择所有WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有WTB_BAOXIUXX信息</returns>
        public DataTable SelectWTB_BAOXIUXXesAll(OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_BAOXIUXXesAll";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }

        /// <summary>
        /// 选择所有WTB_BAOXIUXX信息
        /// </summary>
        /// <returns>所有WTB_BAOXIUXX信息</returns>
        public DataTable SelectWTB_BAOXIUXXesAll()
        {
            return SelectWTB_BAOXIUXXesAll(null);
        }

        /// <summary>
        /// 根据条件选择WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_BAOXIUXX信息</returns>
        public DataTable SelectWTB_BAOXIUXXesDynamic(string WhereClause, string OrderByExpression, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_BAOXIUXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>WTB_BAOXIUXX信息</returns>
        public DataTable SelectWTB_BAOXIUXXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectWTB_BAOXIUXXesDynamic(WhereClause, OrderByExpression, null);
        }



        /// <summary>
        /// 根据条件选择WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_BAOXIUXX信息</returns>
        public DataTable SelectWTB_BAOXIUXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_BAOXIUXXesDynPaged";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择WTB_BAOXIUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>WTB_BAOXIUXX信息</returns>
        public DataTable SelectWTB_BAOXIUXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize)
        {
            return SelectWTB_BAOXIUXXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///根据条件更新WTB_BAOXIUXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateWTB_BAOXIUXXesDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            int result = 0;
            if (UpdateValue == "" || WhereClause == "")
            {
                return 0;
            }
            string spName = "CS_UpdWTB_BAOXIUXXDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///根据条件更新WTB_BAOXIUXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateWTB_BAOXIUXXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateWTB_BAOXIUXXesDynamic(UpdateValue, WhereClause, null);
        }


        #endregion
        #region Private

        private int InsertWTB_BAOXIUXX(WTB_BAOXIUXX WTB_BAOXIUXX, OracleTransaction Transaction)
        {
            string spName = "CS_InsWTB_BAOXIUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WTB_BAOXIUXX.S_ZHUBIAOBH;
            storedParams[1].Value = WTB_BAOXIUXX.INCIDENT_ID;
            storedParams[2].Value = WTB_BAOXIUXX.CASE_TYPE_CD;
            storedParams[3].Value = WTB_BAOXIUXX.FYLY;
            storedParams[4].Value = WTB_BAOXIUXX.FYXS;
            storedParams[5].Value = WTB_BAOXIUXX.FYQM;
            storedParams[6].Value = WTB_BAOXIUXX.FYLB;
            storedParams[7].Value = WTB_BAOXIUXX.FYNR;
            storedParams[8].Value = WTB_BAOXIUXX.BX_DTTM;
            storedParams[9].Value = WTB_BAOXIUXX.CLJB;
            storedParams[10].Value = WTB_BAOXIUXX.CN_DTTM;
            storedParams[11].Value = WTB_BAOXIUXX.BX_LOC_CD;
            storedParams[12].Value = WTB_BAOXIUXX.REPAIR_COMMENT;
            storedParams[13].Value = WTB_BAOXIUXX.I_BEIYONG1;
            storedParams[14].Value = WTB_BAOXIUXX.I_BEIYONG2;
            storedParams[15].Value = WTB_BAOXIUXX.I_BEIYONG3;
            storedParams[16].Value = WTB_BAOXIUXX.S_BEIYONG1;
            storedParams[17].Value = WTB_BAOXIUXX.S_BEIYONG2;
            storedParams[18].Value = WTB_BAOXIUXX.S_BEIYONG3;
            storedParams[19].Value = WTB_BAOXIUXX.D_BEIYONG1;
            storedParams[20].Value = WTB_BAOXIUXX.D_BEIYONG2;
            storedParams[21].Value = WTB_BAOXIUXX.D_BEIYONG3;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            WTB_BAOXIUXX.ID = Convert.ToInt32(storedParams[22].Value);
            return result;
        }
        private bool UpdateWTB_BAOXIUXX(WTB_BAOXIUXX WTB_BAOXIUXX, OracleTransaction Transaction)
        {
            string spName = "CS_UpdWTB_BAOXIUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WTB_BAOXIUXX.S_ZHUBIAOBH;
            storedParams[1].Value = WTB_BAOXIUXX.INCIDENT_ID;
            storedParams[2].Value = WTB_BAOXIUXX.CASE_TYPE_CD;
            storedParams[3].Value = WTB_BAOXIUXX.FYLY;
            storedParams[4].Value = WTB_BAOXIUXX.FYXS;
            storedParams[5].Value = WTB_BAOXIUXX.FYQM;
            storedParams[6].Value = WTB_BAOXIUXX.FYLB;
            storedParams[7].Value = WTB_BAOXIUXX.FYNR;
            storedParams[8].Value = WTB_BAOXIUXX.BX_DTTM;
            storedParams[9].Value = WTB_BAOXIUXX.CLJB;
            storedParams[10].Value = WTB_BAOXIUXX.CN_DTTM;
            storedParams[11].Value = WTB_BAOXIUXX.BX_LOC_CD;
            storedParams[12].Value = WTB_BAOXIUXX.REPAIR_COMMENT;
            storedParams[13].Value = WTB_BAOXIUXX.I_BEIYONG1;
            storedParams[14].Value = WTB_BAOXIUXX.I_BEIYONG2;
            storedParams[15].Value = WTB_BAOXIUXX.I_BEIYONG3;
            storedParams[16].Value = WTB_BAOXIUXX.S_BEIYONG1;
            storedParams[17].Value = WTB_BAOXIUXX.S_BEIYONG2;
            storedParams[18].Value = WTB_BAOXIUXX.S_BEIYONG3;
            storedParams[19].Value = WTB_BAOXIUXX.D_BEIYONG1;
            storedParams[20].Value = WTB_BAOXIUXX.D_BEIYONG2;
            storedParams[21].Value = WTB_BAOXIUXX.D_BEIYONG3;
            storedParams[22].Value = WTB_BAOXIUXX.ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private WTB_BAOXIUXX PopulateWTB_BAOXIUXX(IDataReader dr)
        {
            WTB_BAOXIUXX WTB_BAOXIUXX = new WTB_BAOXIUXX();
            WTB_BAOXIUXX.ID = dr["ID"] == DBNull.Value ? (int)0 : (int)dr["ID"];
            WTB_BAOXIUXX.S_ZHUBIAOBH = dr["S_ZHUBIAOBH"] == DBNull.Value ? null : (string)dr["S_ZHUBIAOBH"];
            WTB_BAOXIUXX.INCIDENT_ID = dr["INCIDENT_ID"] == DBNull.Value ? null : (string)dr["INCIDENT_ID"];
            WTB_BAOXIUXX.CASE_TYPE_CD = dr["CASE_TYPE_CD"] == DBNull.Value ? null : (string)dr["CASE_TYPE_CD"];
            WTB_BAOXIUXX.FYLY = dr["FYLY"] == DBNull.Value ? null : (string)dr["FYLY"];
            WTB_BAOXIUXX.FYXS = dr["FYXS"] == DBNull.Value ? null : (string)dr["FYXS"];
            WTB_BAOXIUXX.FYQM = dr["FYQM"] == DBNull.Value ? null : (string)dr["FYQM"];
            WTB_BAOXIUXX.FYLB = dr["FYLB"] == DBNull.Value ? null : (string)dr["FYLB"];
            WTB_BAOXIUXX.FYNR = dr["FYNR"] == DBNull.Value ? null : (string)dr["FYNR"];
            WTB_BAOXIUXX.BX_DTTM = dr["BX_DTTM"] == DBNull.Value ? null : (string)dr["BX_DTTM"];
            WTB_BAOXIUXX.CLJB = dr["CLJB"] == DBNull.Value ? null : (string)dr["CLJB"];
            WTB_BAOXIUXX.CN_DTTM = dr["CN_DTTM"] == DBNull.Value ? null : (string)dr["CN_DTTM"];
            WTB_BAOXIUXX.BX_LOC_CD = dr["BX_LOC_CD"] == DBNull.Value ? null : (string)dr["BX_LOC_CD"];
            WTB_BAOXIUXX.REPAIR_COMMENT = dr["REPAIR_COMMENT"] == DBNull.Value ? null : (string)dr["REPAIR_COMMENT"];
            WTB_BAOXIUXX.I_BEIYONG1 = dr["I_BEIYONG1"] == DBNull.Value ? null : (int?)dr["I_BEIYONG1"];
            WTB_BAOXIUXX.I_BEIYONG2 = dr["I_BEIYONG2"] == DBNull.Value ? null : (int?)dr["I_BEIYONG2"];
            WTB_BAOXIUXX.I_BEIYONG3 = dr["I_BEIYONG3"] == DBNull.Value ? null : (int?)dr["I_BEIYONG3"];
            WTB_BAOXIUXX.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string)dr["S_BEIYONG1"];
            WTB_BAOXIUXX.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string)dr["S_BEIYONG2"];
            WTB_BAOXIUXX.S_BEIYONG3 = dr["S_BEIYONG3"] == DBNull.Value ? null : (string)dr["S_BEIYONG3"];
            WTB_BAOXIUXX.D_BEIYONG1 = dr["D_BEIYONG1"] == DBNull.Value ? null : (DateTime?)dr["D_BEIYONG1"];
            WTB_BAOXIUXX.D_BEIYONG2 = dr["D_BEIYONG2"] == DBNull.Value ? null : (DateTime?)dr["D_BEIYONG2"];
            WTB_BAOXIUXX.D_BEIYONG3 = dr["D_BEIYONG3"] == DBNull.Value ? null : (DateTime?)dr["D_BEIYONG3"];
            return WTB_BAOXIUXX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
            }
        }
        #endregion
    }
}
#endregion